/**
 * Created by Rimik on 12/04/2014.
 */
public class partA {


    public static void main(String[] args) {
        try{

            if (args[0].toString().equals("Encryption")) {
            String FileNamePlainText = args[1].toString();
            String FileNameKey = args[2].toString();
            String FileNameVector = args[3].toString();
            CBC c = new CBC();
            c.runCBC(FileNameVector, FileNamePlainText, FileNameKey);
        }
        else if (args[0].toString().equals("Decryption")) {
            String FileNameCipherText = args[1].toString();
            String FileNameVector = args[2].toString();
            CBCdecipher c = new CBCdecipher(FileNameVector, FileNameCipherText, "abcdefgh");
            c.runAttack();
        }
        else
        {
            Exception ex = new Exception("WRONG FIELDS");
            throw ex;
        }
    }
    catch (Exception e)
    {
        System.out.println("MISSING FIELDS");
    }
    finally
    {
        System.out.println("\nQUIT");
    }

       // CBC c = new CBC();
        //c.runCBC("1iv.txt", "1Text.txt", "1Key.txt");
       // CBCdecipher c = new CBCdecipher("2iv.txt", "2TextCipher.txt", "abcdefgh");
       // c.runAttack();

    }
}